package(default_visibility = ["//visibility:public"])

load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("//def:ts.bzl", "ts_library")

filegroup(
    name = "templates",
    srcs = [
        "//prow/spyglass/lenses/buildlog:template",
        "//prow/spyglass/lenses/coverage:template",
        "//prow/spyglass/lenses/junit:template",
        "//prow/spyglass/lenses/metadata:template",
        "//prow/spyglass/lenses/podinfo:template",
        "//prow/spyglass/lenses/restcoverage:template",
    ],
)

filegroup(
    name = "resources",
    srcs = [
        "//prow/spyglass/lenses/buildlog:resources",
        "//prow/spyglass/lenses/coverage:resources",
        "//prow/spyglass/lenses/junit:resources",
        "//prow/spyglass/lenses/metadata:resources",
        "//prow/spyglass/lenses/podinfo:resources",
        "//prow/spyglass/lenses/restcoverage:resources",
    ],
)

ts_library(
    name = "lens_api",
    srcs = ["lens.d.ts"],
)

go_library(
    name = "go_default_library",
    srcs = ["lenses.go"],
    importpath = "k8s.io/test-infra/prow/spyglass/lenses",
    visibility = ["//visibility:public"],
    deps = [
        "//prow/spyglass/api:go_default_library",
        "@com_github_sirupsen_logrus//:go_default_library",
    ],
)

filegroup(
    name = "package-srcs",
    srcs = glob(["**"]),
    tags = ["automanaged"],
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [
        ":package-srcs",
        "//prow/spyglass/lenses/buildlog:all-srcs",
        "//prow/spyglass/lenses/common:all-srcs",
        "//prow/spyglass/lenses/coverage:all-srcs",
        "//prow/spyglass/lenses/junit:all-srcs",
        "//prow/spyglass/lenses/metadata:all-srcs",
        "//prow/spyglass/lenses/podinfo:all-srcs",
        "//prow/spyglass/lenses/restcoverage:all-srcs",
    ],
    tags = ["automanaged"],
    visibility = ["//visibility:public"],
)

go_test(
    name = "go_default_test",
    srcs = ["lenses_test.go"],
    embed = [":go_default_library"],
    deps = [
        "//prow/spyglass/api:go_default_library",
        "@com_github_sirupsen_logrus//:go_default_library",
    ],
)
